<?php /* Smarty version 2.6.14, created on 2012-10-21 04:26:36
         compiled from admin_forum.tpl */
?><?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'admin_forum.tpl', 13, false),array('modifier', 'replace', 'admin_forum.tpl', 28, false),array('modifier', 'truncate', 'admin_forum.tpl', 246, false),)), $this);
?><?php
SELanguage::_preload_multi(6000002,6000004,6000005,6000006,6000007,153,943,187,155,6000008,6000019,6000020,104,951,6000010,952,6000011,6000012,6000013,6000014,6000021,175,39,945,6000009,258,6000015,6000016,107,6000017,6000018,6000028,6000055,382,6000029,6000054,1005,6000023,6000025,6000026,6000022,6000024,6000027,1003);
SELanguage::load();
?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin_header.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<h2><?php echo SELanguage::_get(6000002); ?></h2>
<?php echo SELanguage::_get(6000004); ?>
<br />
<br />





<input type='button' class='button' value='<?php echo SELanguage::_get(6000005); ?>' onClick='addCategory();'>
<input type='button' class='button' value='<?php echo SELanguage::_get(6000006); ?>' <?php if (count($this->_tpl_vars['forumcats']) == 0): ?>disabled='disabled'<?php else: ?>onClick='addForum();'<?php endif; ?>>

<br><br>

<table cellpadding='0' cellspacing='0' class='list'>
<tr>
<td class='header' colspan='2'><?php echo SELanguage::_get(6000007); ?></td>
<td class='header' width='150' style='text-align: right;'><?php echo SELanguage::_get(153); ?>&nbsp;&nbsp;</td>
</tr>
<?php unset($this->_sections['forumcat_loop']);
$this->_sections['forumcat_loop']['name'] = 'forumcat_loop';
$this->_sections['forumcat_loop']['loop'] = is_array($_loop=$this->_tpl_vars['forumcats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['forumcat_loop']['show'] = true;
$this->_sections['forumcat_loop']['max'] = $this->_sections['forumcat_loop']['loop'];
$this->_sections['forumcat_loop']['step'] = 1;
$this->_sections['forumcat_loop']['start'] = $this->_sections['forumcat_loop']['step'] > 0 ? 0 : $this->_sections['forumcat_loop']['loop']-1;
if ($this->_sections['forumcat_loop']['show']) {
    $this->_sections['forumcat_loop']['total'] = $this->_sections['forumcat_loop']['loop'];
    if ($this->_sections['forumcat_loop']['total'] == 0)
        $this->_sections['forumcat_loop']['show'] = false;
} else
    $this->_sections['forumcat_loop']['total'] = 0;
if ($this->_sections['forumcat_loop']['show']):

            for ($this->_sections['forumcat_loop']['index'] = $this->_sections['forumcat_loop']['start'], $this->_sections['forumcat_loop']['iteration'] = 1;
                 $this->_sections['forumcat_loop']['iteration'] <= $this->_sections['forumcat_loop']['total'];
                 $this->_sections['forumcat_loop']['index'] += $this->_sections['forumcat_loop']['step'], $this->_sections['forumcat_loop']['iteration']++):
$this->_sections['forumcat_loop']['rownum'] = $this->_sections['forumcat_loop']['iteration'];
$this->_sections['forumcat_loop']['index_prev'] = $this->_sections['forumcat_loop']['index'] - $this->_sections['forumcat_loop']['step'];
$this->_sections['forumcat_loop']['index_next'] = $this->_sections['forumcat_loop']['index'] + $this->_sections['forumcat_loop']['step'];
$this->_sections['forumcat_loop']['first']      = ($this->_sections['forumcat_loop']['iteration'] == 1);
$this->_sections['forumcat_loop']['last']       = ($this->_sections['forumcat_loop']['iteration'] == $this->_sections['forumcat_loop']['total']);
?>
  <tr class='background1'>
  <td class='item' colspan='2' style='font-weight: bold;'><?php echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_title']); ?></td>
  <td class='item' nowrap='nowrap' style='vertical-align: top; text-align: right;'>
    <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_title']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('forumcat_title', ob_get_contents());ob_end_clean(); ?>
    <?php if ($this->_sections['forumcat_loop']['first'] != TRUE): ?><a href='admin_forum.php?task=movecategory&forumcat_id=<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_id']; ?>
'><?php echo SELanguage::_get(943); ?></a> | <?php endif; ?>
    <a href="javascript: editCategory('<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_id']; ?>
', '<?php echo ((is_array($_tmp=$this->_tpl_vars['forumcat_title'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")); ?>
');"><?php echo SELanguage::_get(187); ?></a>
     | <a href="javascript: confirmDeleteCat('<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_id']; ?>
');"><?php echo SELanguage::_get(155); ?></a>
  &nbsp;
  </td>
  </tr>

  <?php unset($this->_sections['forum_loop']);
$this->_sections['forum_loop']['name'] = 'forum_loop';
$this->_sections['forum_loop']['loop'] = is_array($_loop=$this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['forum_loop']['show'] = true;
$this->_sections['forum_loop']['max'] = $this->_sections['forum_loop']['loop'];
$this->_sections['forum_loop']['step'] = 1;
$this->_sections['forum_loop']['start'] = $this->_sections['forum_loop']['step'] > 0 ? 0 : $this->_sections['forum_loop']['loop']-1;
if ($this->_sections['forum_loop']['show']) {
    $this->_sections['forum_loop']['total'] = $this->_sections['forum_loop']['loop'];
    if ($this->_sections['forum_loop']['total'] == 0)
        $this->_sections['forum_loop']['show'] = false;
} else
    $this->_sections['forum_loop']['total'] = 0;
if ($this->_sections['forum_loop']['show']):

            for ($this->_sections['forum_loop']['index'] = $this->_sections['forum_loop']['start'], $this->_sections['forum_loop']['iteration'] = 1;
                 $this->_sections['forum_loop']['iteration'] <= $this->_sections['forum_loop']['total'];
                 $this->_sections['forum_loop']['index'] += $this->_sections['forum_loop']['step'], $this->_sections['forum_loop']['iteration']++):
$this->_sections['forum_loop']['rownum'] = $this->_sections['forum_loop']['iteration'];
$this->_sections['forum_loop']['index_prev'] = $this->_sections['forum_loop']['index'] - $this->_sections['forum_loop']['step'];
$this->_sections['forum_loop']['index_next'] = $this->_sections['forum_loop']['index'] + $this->_sections['forum_loop']['step'];
$this->_sections['forum_loop']['first']      = ($this->_sections['forum_loop']['iteration'] == 1);
$this->_sections['forum_loop']['last']       = ($this->_sections['forum_loop']['iteration'] == $this->_sections['forum_loop']['total']);
?>
    <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_title']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('forum_title', ob_get_contents());ob_end_clean(); ?>
    <?php ob_start(); 
 echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_desc']); 
 $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('forum_desc', ob_get_contents());ob_end_clean(); ?>
    <tr class='background2'>
    <td class='item' valign='top' width='1' style='padding-right: 0px;'><img src='../images/icons/forum_forum16.gif' border='0'></td>
    <td class='item'>
      <div style='font-weight: bold;'><?php echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_title']); ?></div>
      <div><?php echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_desc']); ?></div>
      <div style='margin-top: 10px;'>
        <?php echo SELanguage::_get(6000008); ?> <?php unset($this->_sections['mod_loop']);
$this->_sections['mod_loop']['name'] = 'mod_loop';
$this->_sections['mod_loop']['loop'] = is_array($_loop=$this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_mods']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['mod_loop']['show'] = true;
$this->_sections['mod_loop']['max'] = $this->_sections['mod_loop']['loop'];
$this->_sections['mod_loop']['step'] = 1;
$this->_sections['mod_loop']['start'] = $this->_sections['mod_loop']['step'] > 0 ? 0 : $this->_sections['mod_loop']['loop']-1;
if ($this->_sections['mod_loop']['show']) {
    $this->_sections['mod_loop']['total'] = $this->_sections['mod_loop']['loop'];
    if ($this->_sections['mod_loop']['total'] == 0)
        $this->_sections['mod_loop']['show'] = false;
} else
    $this->_sections['mod_loop']['total'] = 0;
if ($this->_sections['mod_loop']['show']):

            for ($this->_sections['mod_loop']['index'] = $this->_sections['mod_loop']['start'], $this->_sections['mod_loop']['iteration'] = 1;
                 $this->_sections['mod_loop']['iteration'] <= $this->_sections['mod_loop']['total'];
                 $this->_sections['mod_loop']['index'] += $this->_sections['mod_loop']['step'], $this->_sections['mod_loop']['iteration']++):
$this->_sections['mod_loop']['rownum'] = $this->_sections['mod_loop']['iteration'];
$this->_sections['mod_loop']['index_prev'] = $this->_sections['mod_loop']['index'] - $this->_sections['mod_loop']['step'];
$this->_sections['mod_loop']['index_next'] = $this->_sections['mod_loop']['index'] + $this->_sections['mod_loop']['step'];
$this->_sections['mod_loop']['first']      = ($this->_sections['mod_loop']['iteration'] == 1);
$this->_sections['mod_loop']['last']       = ($this->_sections['mod_loop']['iteration'] == $this->_sections['mod_loop']['total']);

 if ($this->_sections['mod_loop']['first'] != TRUE): ?>, <?php endif; 
 echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_mods'][$this->_sections['mod_loop']['index']]['user_displayname']; ?>
 (<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_mods'][$this->_sections['mod_loop']['index']]['user_username']; ?>
)<?php endfor; else: 
 echo SELanguage::_get(6000019); 
 endif; ?>
        &nbsp;[ <a href='javascript: moderators("<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_id']; ?>
", "<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['forum_title'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")))) ? $this->_run_mod_handler('replace', true, $_tmp, '"', '&quot;') : smarty_modifier_replace($_tmp, '"', '&quot;')))) ? $this->_run_mod_handler('replace', true, $_tmp, '&quot;', '\&quot;') : smarty_modifier_replace($_tmp, '&quot;', '\&quot;')); ?>
", <?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_mods_js']; ?>
, <?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_mods_id_js']; ?>
);'><?php echo SELanguage::_get(6000020); ?></a> ]
      </div>
    </td>
    <td class='item' nowrap='nowrap' style='vertical-align: top; text-align: right;'>
      <?php if ($this->_sections['forum_loop']['first'] != TRUE): ?><a href='admin_forum.php?task=moveforum&forum_id=<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_id']; ?>
'><?php echo SELanguage::_get(943); ?></a> | <?php endif; ?>
      <a href='javascript:editForum("<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_id']; ?>
", "<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_id']; ?>
", "<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['forum_title'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")))) ? $this->_run_mod_handler('replace', true, $_tmp, '"', '&quot;') : smarty_modifier_replace($_tmp, '"', '&quot;')))) ? $this->_run_mod_handler('replace', true, $_tmp, '&quot;', '\&quot;') : smarty_modifier_replace($_tmp, '&quot;', '\&quot;')); ?>
", "<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['forum_desc'])) ? $this->_run_mod_handler('replace', true, $_tmp, "&#039;", "\&#039;") : smarty_modifier_replace($_tmp, "&#039;", "\&#039;")))) ? $this->_run_mod_handler('replace', true, $_tmp, "'", "\'") : smarty_modifier_replace($_tmp, "'", "\'")))) ? $this->_run_mod_handler('replace', true, $_tmp, '"', '&quot;') : smarty_modifier_replace($_tmp, '"', '&quot;')))) ? $this->_run_mod_handler('replace', true, $_tmp, '&quot;', '\&quot;') : smarty_modifier_replace($_tmp, '&quot;', '\&quot;')))) ? $this->_run_mod_handler('replace', true, $_tmp, "<", "&lt;") : smarty_modifier_replace($_tmp, "<", "&lt;")))) ? $this->_run_mod_handler('replace', true, $_tmp, ">", "&gt;") : smarty_modifier_replace($_tmp, ">", "&gt;")); ?>
", <?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_level_view']; ?>
, <?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_level_post']; ?>
);'><?php echo SELanguage::_get(187); ?></a>
       | <a href="javascript: confirmDeleteForum('<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forums'][$this->_sections['forum_loop']['index']]['forum_id']; ?>
');"><?php echo SELanguage::_get(155); ?></a>
    &nbsp;
    </td>
    </tr>
  <?php endfor; endif; 
 endfor; endif; ?>
</table>

<?php echo '
<script type="text/javascript">
<!-- 
var forumcat_id = 0;
function addCategory() {
  $(\'forumcat_title\').value = \'\';
  $(\'forumcat_title\').defaultValue = \'\';
  $(\'forumcat_id\').value = 0;
  $(\'forumcat_task\').value = "addcategory";
  $(\'forumcat_submit\').value = "'; 
 echo SELanguage::_get(104); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(104); 
 echo '\', \'#TB_inline?height=250&width=350&inlineId=addcategory\', \'\', \'../images/trans.gif\');
}

function editCategory(id, title) {
  $(\'forumcat_title\').value = title;
  $(\'forumcat_title\').defaultValue = title;
  $(\'forumcat_id\').value = id;
  $(\'forumcat_task\').value = "editcategory";
  $(\'forumcat_submit\').value = "'; 
 echo SELanguage::_get(951); 
 echo '";
  TB_show(\''; 
 echo SELanguage::_get(951); 
 echo '\', \'#TB_inline?height=250&width=350&inlineId=addcategory\', \'\', \'../images/trans.gif\');
}

function confirmDeleteCat(id) {
  forumcat_id = id;
  forum_id = 0;
  $(\'confirm_message\').innerHTML = \''; 
 echo SELanguage::_get(6000010); 
 echo '\';
  TB_show(\''; 
 echo SELanguage::_get(952); 
 echo '\', \'#TB_inline?height=150&width=300&inlineId=confirmdelete\', \'\', \'../images/trans.gif\');
}


var forum_id = 0;
function addForum() {
  $(\'forum_forumcat_id\').options[0].defaultSelected = true;
  $(\'forum_title\').value = \'\';
  $(\'forum_title\').defaultValue = \'\';
  $(\'forum_desc\').value = \'\';
  $(\'forum_desc\').defaultValue = \'\';
  $(\'forum_id\').value = 0;
  $(\'forum_task\').value = "addforum";
  $(\'forum_submit\').value = "'; 
 echo SELanguage::_get(6000011); 
 echo '";
  for(var i=0;i<$(\'view_levels\').options.length;i++) { 
    $(\'view_levels\').options[i].selected = true; 
    $(\'view_levels\').options[i].defaultSelected = true; 
  }
  for(var i=0;i<$(\'post_levels\').options.length;i++) { 
    $(\'post_levels\').options[i].selected = true; 
    $(\'post_levels\').options[i].defaultSelected = true; 
  }
  TB_show(\''; 
 echo SELanguage::_get(6000011); 
 echo '\', \'#TB_inline?height=500&width=450&inlineId=addforum\', \'\', \'../images/trans.gif\');
}

function editForum(id, cat_id, title, description, level_view, level_post) {
  $(\'forum_forumcat_id\').value = cat_id;
  $(\'forum_forumcat_id\').options[$(\'forum_forumcat_id\').selectedIndex].defaultSelected = true;
  $(\'forum_title\').value = title;
  $(\'forum_title\').defaultValue = title;
  $(\'forum_desc\').value = description;
  $(\'forum_desc\').defaultValue = description;
  $(\'forum_id\').value = id;
  $(\'forum_task\').value = "editforum";
  $(\'forum_submit\').value = "'; 
 echo SELanguage::_get(6000012); 
 echo '";
  for(var i=0;i<$(\'view_levels\').options.length;i++) { 
    if(level_view.indexOf($(\'view_levels\').options[i].value) == -1) {
      $(\'view_levels\').options[i].selected = false; 
      $(\'view_levels\').options[i].defaultSelected = false; 
    } else {
      $(\'view_levels\').options[i].selected = true; 
      $(\'view_levels\').options[i].defaultSelected = true; 
    }
  }
  for(var i=0;i<$(\'post_levels\').options.length;i++) { 
    if(level_post.indexOf($(\'post_levels\').options[i].value) == -1) {
      $(\'post_levels\').options[i].selected = false; 
      $(\'post_levels\').options[i].defaultSelected = false; 
    } else {
      $(\'post_levels\').options[i].selected = true; 
      $(\'post_levels\').options[i].defaultSelected = true; 
    }
  }
  TB_show(\''; 
 echo SELanguage::_get(6000012); 
 echo '\', \'#TB_inline?height=500&width=450&inlineId=addforum\', \'\', \'../images/trans.gif\');
}

function confirmDeleteForum(id) {
  forum_id = id;
  forumcat_id = 0;
  $(\'confirm_message\').innerHTML = \''; 
 echo SELanguage::_get(6000013); 
 echo '\';
  TB_show(\''; 
 echo SELanguage::_get(6000014); 
 echo '\', \'#TB_inline?height=150&width=300&inlineId=confirmdelete\', \'\', \'../images/trans.gif\');
}

var forum_moderators = [];
function moderators(id, title, moderators_full, moderators_ids) {
  $(\'forummoderator_forum_id\').value = id;
  forum_moderators = moderators_ids;
  $(\'moderator_table\').getElements(\'span[id=mod_span]\').each(function(el) { el.destroy(); });
  if(moderators_full.length > 0) {
    for(var m=0;m<moderators_full.length;m++) {
      var newSpan = new Element(\'span\', {id: \'mod_span\', html: \'<input type="hidden" name="mods[]" value="\' + moderators_full[m].user_id + \'"><input type="checkbox" style="vertical-align: middle;" name="mods_keep[\' + moderators_full[m].user_id + \']" value="1" checked="checked">\' + moderators_full[m].user_displayname + \' (\' + moderators_full[m].user_username + \')&nbsp;&nbsp;&nbsp;\'});
      newSpan.inject($(\'moderator_column\'));
    }
    $(\'mod_none\').style.display = \'none\';
    $(\'mod_row\').style.display = \'\';
  } else {
    $(\'mod_none\').style.display = \'\';
    $(\'mod_row\').style.display = \'none\';
  }
  TB_show(\''; 
 echo SELanguage::_get(6000021); 
 echo ' - "\' + title + \'"\', \'#TB_inline?height=450&width=550&inlineId=moderators\', \'\', \'../images/trans.gif\');
}



function deletedo() {
  if(forum_id != 0) {
    window.location = \'admin_forum.php?task=deleteforum&forum_id=\'+forum_id;
  } else if(forumcat_id != 0) {
    window.location = \'admin_forum.php?task=deletecategory&forumcat_id=\'+forumcat_id;
  }
}

//-->
</script>
'; ?>



<div style='display: none;' id='confirmdelete'>
  <div style='margin-top: 10px;' id='confirm_message'>
    <?php echo SELanguage::_get(6000010); ?>
  </div>
  <br>
  <input type='button' class='button' value='<?php echo SELanguage::_get(175); ?>' onClick='parent.TB_remove();parent.deletedo();'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
</div>


<div style='display: none;' id='addcategory'>
  <form action='admin_forum.php' method='post' target='_parent' onSubmit="<?php echo 'if(this.forumcat_title.value == \'\'){ alert(\''; 
 echo SELanguage::_get(945); 
 echo '\'); return false;}else{return true;}'; ?>
">
  <div style='margin-top: 10px;'><?php echo SELanguage::_get(6000009); ?></div>
  <br>
  <table cellpadding='0' cellspacing='0'>
  <tr>
  <td align='right' class='form1'><?php echo SELanguage::_get(258); ?>:&nbsp;</td>
  <td class='form2'><input type='text' class='text' name='forumcat_title' id='forumcat_title' size='30' maxlength='50'></td>
  </tr>
  <tr>
  <td class='form1'>&nbsp;</td>
  <td class='form2'>
    <input type='submit' class='button' id='forumcat_submit' value='<?php echo SELanguage::_get(104); ?>'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
    <input type='hidden' name='task' id='forumcat_task' value='addcategory'>
    <input type='hidden' name='forumcat_id' id='forumcat_id' value='0'>
    </form>
  </td>
  </tr>
  </table>
</div>


<div style='display: none;' id='addforum'>
  <form action='admin_forum.php' method='post' target='_parent' onSubmit="<?php echo 'if(this.forum_title.value == \'\'){ alert(\''; 
 echo SELanguage::_get(6000015); 
 echo '\'); return false;}else{return true;}'; ?>
">
  <div style='margin-top: 10px;'><?php echo SELanguage::_get(6000016); ?></div>
  <br>
  <table cellpadding='0' cellspacing='0' width='100%'>
  <tr>
  <td class='form1' align='right'><?php echo SELanguage::_get(107); ?>&nbsp;</td>
  <td class='form2'>
    <select name='forumcat_id' id='forum_forumcat_id' class='text'>
    <?php unset($this->_sections['forumcat_loop']);
$this->_sections['forumcat_loop']['name'] = 'forumcat_loop';
$this->_sections['forumcat_loop']['loop'] = is_array($_loop=$this->_tpl_vars['forumcats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['forumcat_loop']['show'] = true;
$this->_sections['forumcat_loop']['max'] = $this->_sections['forumcat_loop']['loop'];
$this->_sections['forumcat_loop']['step'] = 1;
$this->_sections['forumcat_loop']['start'] = $this->_sections['forumcat_loop']['step'] > 0 ? 0 : $this->_sections['forumcat_loop']['loop']-1;
if ($this->_sections['forumcat_loop']['show']) {
    $this->_sections['forumcat_loop']['total'] = $this->_sections['forumcat_loop']['loop'];
    if ($this->_sections['forumcat_loop']['total'] == 0)
        $this->_sections['forumcat_loop']['show'] = false;
} else
    $this->_sections['forumcat_loop']['total'] = 0;
if ($this->_sections['forumcat_loop']['show']):

            for ($this->_sections['forumcat_loop']['index'] = $this->_sections['forumcat_loop']['start'], $this->_sections['forumcat_loop']['iteration'] = 1;
                 $this->_sections['forumcat_loop']['iteration'] <= $this->_sections['forumcat_loop']['total'];
                 $this->_sections['forumcat_loop']['index'] += $this->_sections['forumcat_loop']['step'], $this->_sections['forumcat_loop']['iteration']++):
$this->_sections['forumcat_loop']['rownum'] = $this->_sections['forumcat_loop']['iteration'];
$this->_sections['forumcat_loop']['index_prev'] = $this->_sections['forumcat_loop']['index'] - $this->_sections['forumcat_loop']['step'];
$this->_sections['forumcat_loop']['index_next'] = $this->_sections['forumcat_loop']['index'] + $this->_sections['forumcat_loop']['step'];
$this->_sections['forumcat_loop']['first']      = ($this->_sections['forumcat_loop']['iteration'] == 1);
$this->_sections['forumcat_loop']['last']       = ($this->_sections['forumcat_loop']['iteration'] == $this->_sections['forumcat_loop']['total']);
?>
      <option value='<?php echo $this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_id']; ?>
'><?php echo SELanguage::_get($this->_tpl_vars['forumcats'][$this->_sections['forumcat_loop']['index']]['forumcat_title']); ?></option>
    <?php endfor; endif; ?>
    </select>
  </td>
  </tr>
  <tr>
  <td class='form1' align='right'><?php echo SELanguage::_get(6000017); ?>&nbsp;</td>
  <td class='form2'><input type='text' class='text' name='forum_title' id='forum_title' size='50' maxlength='50'></td>
  </tr>
  <tr>
  <td class='form1' align='right' valign='top'><?php echo SELanguage::_get(6000018); ?>&nbsp;</td>
  <td class='form2'><textarea name='forum_desc' class='text' id='forum_desc' rows='7' cols='50'></textarea></td>
  </tr>
  <tr>
  <td class='form1' align='right' valign='top'>&nbsp;</td>
  <td class='form2'>
    <?php echo SELanguage::_get(6000028); ?><br>
    <select size='4' class='text' name='view_levels[]' id='view_levels' multiple='multiple' style='width: 250px;'>
      <option value='0' selected='selected'><?php echo SELanguage::_get(6000055); ?></option>
    <?php unset($this->_sections['level_loop']);
$this->_sections['level_loop']['name'] = 'level_loop';
$this->_sections['level_loop']['loop'] = is_array($_loop=$this->_tpl_vars['levels']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['level_loop']['show'] = true;
$this->_sections['level_loop']['max'] = $this->_sections['level_loop']['loop'];
$this->_sections['level_loop']['step'] = 1;
$this->_sections['level_loop']['start'] = $this->_sections['level_loop']['step'] > 0 ? 0 : $this->_sections['level_loop']['loop']-1;
if ($this->_sections['level_loop']['show']) {
    $this->_sections['level_loop']['total'] = $this->_sections['level_loop']['loop'];
    if ($this->_sections['level_loop']['total'] == 0)
        $this->_sections['level_loop']['show'] = false;
} else
    $this->_sections['level_loop']['total'] = 0;
if ($this->_sections['level_loop']['show']):

            for ($this->_sections['level_loop']['index'] = $this->_sections['level_loop']['start'], $this->_sections['level_loop']['iteration'] = 1;
                 $this->_sections['level_loop']['iteration'] <= $this->_sections['level_loop']['total'];
                 $this->_sections['level_loop']['index'] += $this->_sections['level_loop']['step'], $this->_sections['level_loop']['iteration']++):
$this->_sections['level_loop']['rownum'] = $this->_sections['level_loop']['iteration'];
$this->_sections['level_loop']['index_prev'] = $this->_sections['level_loop']['index'] - $this->_sections['level_loop']['step'];
$this->_sections['level_loop']['index_next'] = $this->_sections['level_loop']['index'] + $this->_sections['level_loop']['step'];
$this->_sections['level_loop']['first']      = ($this->_sections['level_loop']['iteration'] == 1);
$this->_sections['level_loop']['last']       = ($this->_sections['level_loop']['iteration'] == $this->_sections['level_loop']['total']);
?>
      <option value='<?php echo $this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_id']; ?>
' selected='selected'><?php echo ((is_array($_tmp=$this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_name'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 75, "...", true) : smarty_modifier_truncate($_tmp, 75, "...", true)); 
 if ($this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_default'] == 1): ?> <?php echo SELanguage::_get(382); 
 endif; ?></option>
    <?php endfor; endif; ?>
    </select>
  </td>
  </tr>
  <tr>
  <td class='form1' align='right' valign='top'>&nbsp;</td>
  <td class='form2'>
    <?php echo SELanguage::_get(6000029); ?><br>
    <select size='4' class='text' name='post_levels[]' id='post_levels' multiple='multiple' style='width: 250px;'>
      <option value='0' selected='selected'><?php echo SELanguage::_get(6000055); ?></option>
    <?php unset($this->_sections['level_loop']);
$this->_sections['level_loop']['name'] = 'level_loop';
$this->_sections['level_loop']['loop'] = is_array($_loop=$this->_tpl_vars['levels']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['level_loop']['show'] = true;
$this->_sections['level_loop']['max'] = $this->_sections['level_loop']['loop'];
$this->_sections['level_loop']['step'] = 1;
$this->_sections['level_loop']['start'] = $this->_sections['level_loop']['step'] > 0 ? 0 : $this->_sections['level_loop']['loop']-1;
if ($this->_sections['level_loop']['show']) {
    $this->_sections['level_loop']['total'] = $this->_sections['level_loop']['loop'];
    if ($this->_sections['level_loop']['total'] == 0)
        $this->_sections['level_loop']['show'] = false;
} else
    $this->_sections['level_loop']['total'] = 0;
if ($this->_sections['level_loop']['show']):

            for ($this->_sections['level_loop']['index'] = $this->_sections['level_loop']['start'], $this->_sections['level_loop']['iteration'] = 1;
                 $this->_sections['level_loop']['iteration'] <= $this->_sections['level_loop']['total'];
                 $this->_sections['level_loop']['index'] += $this->_sections['level_loop']['step'], $this->_sections['level_loop']['iteration']++):
$this->_sections['level_loop']['rownum'] = $this->_sections['level_loop']['iteration'];
$this->_sections['level_loop']['index_prev'] = $this->_sections['level_loop']['index'] - $this->_sections['level_loop']['step'];
$this->_sections['level_loop']['index_next'] = $this->_sections['level_loop']['index'] + $this->_sections['level_loop']['step'];
$this->_sections['level_loop']['first']      = ($this->_sections['level_loop']['iteration'] == 1);
$this->_sections['level_loop']['last']       = ($this->_sections['level_loop']['iteration'] == $this->_sections['level_loop']['total']);
?>
      <option value='<?php echo $this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_id']; ?>
' selected='selected'><?php echo ((is_array($_tmp=$this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_name'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 75, "...", true) : smarty_modifier_truncate($_tmp, 75, "...", true)); 
 if ($this->_tpl_vars['levels'][$this->_sections['level_loop']['index']]['level_default'] == 1): ?> <?php echo SELanguage::_get(382); 
 endif; ?></option>
    <?php endfor; endif; ?>
    </select>
  </td>
  </tr>
  <tr>
  <td class='form1'>&nbsp;</td>
  <td class='form2'>
    <input type='submit' class='button' id='forum_submit' value='<?php echo SELanguage::_get(6000011); ?>'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
    <input type='hidden' name='task' id='forum_task' value='addforum'>
    <input type='hidden' name='forum_id' id='forum_id' value='0'>
    </form>
  </td>
  </tr>
  </table>

</div>




<div style='display: none;' id='moderators'>

    <?php echo '
  <script type="text/javascript">
  <!-- 
    function searchUsers(mod_user, page) {
      if(mod_user == \'\') { alert(\''; 
 echo SELanguage::_get(6000054); 
 echo '\'); return false; }
      var url = \'admin_forum.php?task=searchusers&mod_user=\'+mod_user+\'&page=\'+page;
      var request = new Request.JSON({secure: false, url: url,
		onComplete: function(jsonObj) {
			if(jsonObj.total_results == 0) {
			  $(\'TB_window\').getElement(\'div[id=no_users]\').style.display = \'block\';
			  $(\'TB_window\').getElement(\'div[id=results]\').style.display = \'none\';
			} else {
			  $(\'TB_window\').getElement(\'div[id=no_users]\').style.display = \'none\';
			  $(\'TB_window\').getElement(\'div[id=results]\').style.display = \'block\';
			  $(\'TB_window\').getElement(\'div[id=results]\').innerHTML = \'\';
			  $(\'TB_window\').getElement(\'div[id=pages]\').innerHTML = \'\';
			   
			  if(jsonObj.total_results > jsonObj.results.length) {
			    $(\'TB_window\').getElement(\'div[id=pages]\').style.display = \'block\';
			    var total_pages = Math.ceil(jsonObj.total_results/10);
			    var newHTML = \''; 
 echo SELanguage::_get(1005); 
 echo '\';
			    for(var p=1;p<=total_pages;p++) {
			      if(p == jsonObj.page) {
			        newHTML += \' <b>\'+p+\'</b> \';
			      } else {
			        newHTML += \' <a href="javascript:searchUsers(\\\'\'+mod_user+\'\\\', \'+p+\');">\'+p+\'</a> \';
			      }
			    }
			    $(\'TB_window\').getElement(\'div[id=pages]\').innerHTML = newHTML;
			  }

			  newHTML = \'\';
			  for(var i=0;i<jsonObj.results.length;i++) {
			    newHTML += "<div><input type=\'checkbox\' id=\'user_" + jsonObj.results[i].id + "\' ";
			    if(forum_moderators.indexOf(jsonObj.results[i].id) == -1) {
			      newHTML += "onClick=\\"this.disabled=true;addMod(\'"+jsonObj.results[i].id+"\', \'"+jsonObj.results[i].display_name+"\', \'"+jsonObj.results[i].username+"\');\\"";
			    } else {
			      newHTML += "disabled=\'disabled\' checked=\'checked\'";
			    }
			    newHTML += "> <label for=\'user_" + jsonObj.results[i].id + "\'>" + jsonObj.results[i].display_name + " (" + jsonObj.results[i].username + ")</label></div>";
			  }
			  $(\'TB_window\').getElement(\'div[id=results]\').innerHTML = newHTML;
			}
		}
    }).send();
    }

    function addMod(user_id, display_name, username) {
      forum_moderators.push(user_id);
      $(\'TB_window\').getElement(\'tr[id=mod_none]\').style.display = \'none\';
      $(\'TB_window\').getElement(\'tr[id=mod_row]\').style.display = \'\';
      var newSpan = new Element(\'span\', {id: \'mod_span\', html: \'<input type="hidden" name="mods[]" value="\' + user_id + \'"><input type="checkbox" style="vertical-align: middle;" name="mods_keep[\' + user_id + \']" value="1" checked="checked"> \' + display_name + \' (\' + username + \')&nbsp;&nbsp;&nbsp;\'});
      newSpan.inject($(\'TB_window\').getElement(\'td[id=moderator_column]\'));
    }
  //-->
  </script>
  '; ?>


  <form action='admin_forum.php' method='post' target='_parent'>
  <div style='margin-top: 10px;'><?php echo SELanguage::_get(6000023); ?></div>
  <br>

  <table cellpadding='0' cellspacing='0' class='list' id='moderator_table' style='margin-bottom: 10px;'>
  <tr><td class='header'><?php echo SELanguage::_get(6000025); ?></td></tr>
  <tr id='mod_none' class='background2'><td class='item'><?php echo SELanguage::_get(6000026); ?></td></tr>
  <tr id='mod_row' class='background2'><td class='item' id='moderator_column'></td></tr>
  </table>

  <input type='submit' class='button' value='<?php echo SELanguage::_get(6000022); ?>'> <input type='button' class='button' value='<?php echo SELanguage::_get(39); ?>' onClick='parent.TB_remove();'>
  <input type='hidden' name='task' value='moderators'>
  <input type='hidden' name='forummoderator_forum_id' id='forummoderator_forum_id' value='0'>
  </form>
  
  <div style='padding: 10px; background: #EEEEEE; border: 1px solid #CCCCCC; margin-top: 15px;'>
    <div>
      <?php echo SELanguage::_get(6000024); ?>
    </div>
    <div style='margin-top: 7px;'>
      <form method='post' onSubmit='searchUsers(this.mod_user.value, 1); return false;'>
      <input type='text' class='text' name='mod_user' id='mod_user' size='50' maxlength='50'>
      <input type='submit' class='button_small' value='<?php echo SELanguage::_get(6000027); ?>'>
      </form>
    </div>
  </div>

  <br>
  
  <div id='no_users' style='width:100%;height:125px;overflow:auto;border:1px solid #AAAAAA;display:none;'><?php echo SELanguage::_get(1003); ?></div>
  <div id='results' style='width:70%;height:125px;overflow:auto;border:1px solid #AAAAAA;display:none;padding:6px;'></div>
  <div id='pages' style='display: none; margin-top: 5px;'></div>

</div>


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin_footer.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>